package com.dyz.controller;

import com.dyz.domain.SysUser;
import com.dyz.model.Result;
import com.dyz.service.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Api(tags = "测试接口")
@RequestMapping("/admin")
public class TestController {
    @Resource
    private ISysUserService userService;
    @GetMapping("/search/user/{id}")
    @ApiOperation(value = "查询用户详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long", paramType = "path"),
    })
    public Result<SysUser> selectUser(@PathVariable("id") Long id){
        SysUser user = userService.getById(id);
        return Result.success(user);
    }
}
